home *** CD-ROM | disk | FTP | other *** search
/ Programming Windows 95 with MFC / Programming Windows 95 with MFC (Microsoft Programming Series)(097-0001465)(1996).iso / CODE / Chap06 / DlgCalc / DlgCalc.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-05  |  1.8 KB  |  81 lines

  1. //***********************************************************************
  2. //
  3. //  DlgCalc.h
  4. //
  5. //***********************************************************************
  6.  
  7. class CMyApp : public CWinApp
  8. {
  9. public:
  10.     virtual BOOL InitInstance ();
  11. };
  12.  
  13. class CCalcDialog : public CDialog
  14. {
  15. private:
  16.     HACCEL m_hAccel;
  17.     double m_dbStack[4];
  18.     double m_dbMemory;
  19.     CString m_strDisplay;
  20.     CString m_strFormat;
  21.     CRect m_rect;
  22.     int m_cxChar;
  23.     int m_cyChar;
  24.  
  25.     BOOL m_bFixPending;
  26.     BOOL m_bErrorFlag;
  27.     BOOL m_bDecimalInString;
  28.     BOOL m_bStackLiftEnabled;
  29.     BOOL m_bNewX;
  30.  
  31.     void LiftStack ();
  32.     void DropStack ();
  33.     void DisplayXRegister ();
  34.     void UpdateDisplay (CString&);
  35.  
  36. public:
  37.     CCalcDialog ();
  38.     virtual BOOL OnInitDialog ();
  39.     virtual BOOL PreTranslateMessage (MSG*);
  40.  
  41. protected:
  42.     virtual BOOL OnCommand (WPARAM, LPARAM);
  43.     virtual void OnCancel ();
  44.     virtual void PostNcDestroy ();
  45.  
  46.     afx_msg void OnPaint ();
  47.     afx_msg void OnSysCommand (UINT, LPARAM);
  48.     afx_msg void OnDigit (UINT);
  49.     afx_msg void OnAdd ();
  50.     afx_msg void OnSubtract ();
  51.     afx_msg void OnMultiply ();
  52.     afx_msg void OnDivide ();
  53.     afx_msg void OnEnter ();
  54.     afx_msg void OnChangeSign ();
  55.     afx_msg void OnExponent ();
  56.     afx_msg void OnStore ();
  57.     afx_msg void OnRecall ();
  58.     afx_msg void OnFix ();
  59.     afx_msg void OnClear ();
  60.     afx_msg void OnDecimal ();
  61.     afx_msg void OnDelete ();
  62.  
  63.     DECLARE_MESSAGE_MAP ()
  64. };
  65.  
  66. class CAboutDialog : public CDialog
  67. {
  68. private:
  69.     CRect m_rect;
  70.  
  71. public:
  72.     CAboutDialog (CWnd* pParentWnd = NULL) :
  73.         CDialog (IDD_ABOUTDLG, pParentWnd) {}
  74.  
  75.     virtual BOOL OnInitDialog ();
  76.  
  77. protected:
  78.     afx_msg void OnPaint ();
  79.     DECLARE_MESSAGE_MAP ()
  80. };
  81.